Conversation
|
Looks like this messes with the auto-update script for the lit test... hmm. Otherwise though this should be ready. |
| // Log it at the right time later using a lambda. Note that we can't just | ||
| // capture |value| for the lambda, as the loop modifies it. | ||
| (() => { | ||
| var global = value; |
There was a problem hiding this comment.
Not surprised to be surprised once again by JS semantics. Even the var global = value is not enough to avoid the need for this outer lambda?
There was a problem hiding this comment.
It isn't enough, correct. For loops etc. don't create scopes in JS like functions do.
| try { | ||
| actualValue = global.value; | ||
| } catch (e) { | ||
| if (e.message.startsWith('get WebAssembly.Global.value')) { |
There was a problem hiding this comment.
-
Can we check the type of the error rather than the message? Error messages are not standardized and may differ between implementations.
-
Maybe we should print something else to distinguish this case from an exported global actually containing null.
There was a problem hiding this comment.
- I think it's just a generic RuntimeError, so the text is really all we have to go on...
- Hmm, but we'd need to print some value in other fuzzer places too. I don't think this is ambiguous - this happens only for the illegal types. So if the type is v128, we know 'null' means "i can't print this" etc.
| // Log the global's value. (We use "calling" here to match the output | ||
| // for calls, which simplifies the fuzzer.) | ||
| std::cout << "[fuzz-exec] calling " << exp->name << "\n"; |
There was a problem hiding this comment.
Can we remove "calling" everywhere as a follow-up?
There was a problem hiding this comment.
Any idea for what to replace it with? We need something to differentiate it from other things. I don't have a good idea myself...
|
I worked around the auto-updater test issue with a tiny manual test. We really don't need any more here. |
We already exported globals in the fuzzer, but did not do anything with
them. This logs out their values, at the same time that we log out the
values returned from calling exported functions (and using the same
reordering etc.).